<template>
	<view class="html">
		<view v-for="(item,index) in buttonList" :key="index">
			<u-button @click="toImageTran(item)" :type="item.type" :disabled="item.disabled" class="btn" :plain="true"
				:hairline="true" :text="item.label"></u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				buttonList: [{
					label: '百度图片翻译',
					value: 'baidu',
					type: 'primary',
					disabled: false
				}, {
					label: '阿里云图片翻译',
					value: 'ali',
					type: 'success',
					disabled: false
				}, {
					label: '有道云图片翻译',
					value: 'youdao',
					type: 'warning',
					disabled: true
				}]
			}
		},
		methods: {
			toImageTran(item) {
				switch (item.value) {
					case "baidu":
						uni.navigateTo({
							url: '/pages/translate/imageTran/baiduImageTranslate'
						})
						break;
					case "ali":
						uni.navigateTo({
							url: '/pages/translate/imageTran/aliImageTranslate'
						})
						break;
				}
			}
		}
	}
</script>

<style lang="scss">
	.html {
		width: 96vw;
		margin: 0 auto;

		.btn {
			margin-top: 15%;
		}
	}
</style>
